package com.ama.service.impl;

import com.ama.dao.StaffDao;
import com.ama.pojo.Staff;
import com.ama.service.StaffService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class StaffServiceImpl implements StaffService {
    @Autowired
    private StaffDao staffDao ;

    @Override
    public int deleteById(Long staffId) {
        return staffDao.deleteById(staffId);
    }

    @Override
    public int insert(Staff staff) {
        return staffDao.insertStaff(staff);
    }

    @Override
    public int insertSelective(Staff staff) {
        return staffDao.insertSelective(staff);
    }

    @Override
    public Staff selectById(Long staffId) {
        return staffDao.selectByPrimaryKey(staffId);
    }

    @Override
    public List<Staff> selectAll() {
        return staffDao.selectAll();
    }

    @Override
    public int updateByIdSelective(Staff staff) {
        return staffDao.updateByPrimaryKeySelective(staff);
    }

    @Override
    public int updateById(Staff staff) {
        return staffDao.updateByPrimaryKey(staff);
    }

    @Override
    public Staff selectByIdAndPassword(Long staffId, String password) {
        return staffDao.selectByIdAndPassword(staffId,password);
    }
}
